package treeviewer;

import java.util.ArrayList;
import java.util.List;

public class Factory {
	public static List<Country> createTree() {
		//
		Country cn = new Country("cn");
		Country us = new Country("us");
		Country jp = new Country("jp");
		//
		City beijing = new City("beijing");
		City shanghai = new City("shanghai");
		City newyork = new City("newyork");
		City la = new City("la");
		City tokyo = new City("tokyo");
		City osaka = new City("osaka");
		//
		ArrayList<People> list = new ArrayList<>();
		list.add(new People("People1"));
		list.add(new People("People2"));
		list.add(new People("People3"));
		beijing.setChildren(list);
		//
		list = new ArrayList<>();
		list.add(new People("People4"));
		list.add(new People("People5"));
		list.add(new People("People6"));
		shanghai.setChildren(list);
		//
		list = new ArrayList<>();
		list.add(new People("tom"));
		list.add(new People("rose"));
		list.add(new People("john"));
		newyork.setChildren(list);
		//
		list = new ArrayList<>();
		list.add(new People("Sofia"));
		list.add(new People("sarah"));
		list.add(new People("Jennifer"));
		la.setChildren(list);
		//
		list = new ArrayList<>();
		list.add(new People("People7"));
		list.add(new People("People8"));
		list.add(new People("People9"));
		tokyo.setChildren(list);
		//
		list = new ArrayList<>();
		list.add(new People("People10"));
		list.add(new People("People11"));
		list.add(new People("People12"));
		osaka.setChildren(list);

		//
		//
		ArrayList<City> citys = new ArrayList<>();
		citys.add(beijing);
		citys.add(shanghai);
		cn.setChildren(citys);
		//
		citys = new ArrayList<>();
		citys.add(newyork);
		citys.add(la);
		us.setChildren(citys);
		//
		citys = new ArrayList<>();
		citys.add(tokyo);
		citys.add(osaka);
		jp.setChildren(citys);
		//
		ArrayList<Country> countrys = new ArrayList<>();
		countrys.add(cn);
		countrys.add(us);
		countrys.add(jp);
		return countrys;
	}

}
